# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MigrationCenter.V1.Model.AssetFrame do
  @moduledoc """
  Contains data reported from an inventory source on an asset.

  ## Attributes

  *   `attributes` (*type:* `map()`, *default:* `nil`) - Generic asset attributes.
  *   `collectionType` (*type:* `String.t`, *default:* `nil`) - Optional. Frame collection type, if not specified the collection type will be based on the source type of the source the frame was reported on.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels as key value pairs.
  *   `machineDetails` (*type:* `GoogleApi.MigrationCenter.V1.Model.MachineDetails.t`, *default:* `nil`) - Asset information specific for virtual machines.
  *   `performanceSamples` (*type:* `list(GoogleApi.MigrationCenter.V1.Model.PerformanceSample.t)`, *default:* `nil`) - Asset performance data samples. Samples that are from more than 40 days ago or after tomorrow are ignored.
  *   `reportTime` (*type:* `DateTime.t`, *default:* `nil`) - The time the data was reported.
  *   `traceToken` (*type:* `String.t`, *default:* `nil`) - Optional. Trace token is optionally provided to assist with debugging and traceability.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :attributes => map() | nil,
          :collectionType => String.t() | nil,
          :labels => map() | nil,
          :machineDetails => GoogleApi.MigrationCenter.V1.Model.MachineDetails.t() | nil,
          :performanceSamples =>
            list(GoogleApi.MigrationCenter.V1.Model.PerformanceSample.t()) | nil,
          :reportTime => DateTime.t() | nil,
          :traceToken => String.t() | nil
        }

  field(:attributes, type: :map)
  field(:collectionType)
  field(:labels, type: :map)
  field(:machineDetails, as: GoogleApi.MigrationCenter.V1.Model.MachineDetails)

  field(:performanceSamples, as: GoogleApi.MigrationCenter.V1.Model.PerformanceSample, type: :list)

  field(:reportTime, as: DateTime)
  field(:traceToken)
end

defimpl Poison.Decoder, for: GoogleApi.MigrationCenter.V1.Model.AssetFrame do
  def decode(value, options) do
    GoogleApi.MigrationCenter.V1.Model.AssetFrame.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MigrationCenter.V1.Model.AssetFrame do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
